package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_goods_onedollar", schema = "", catalog = "onedollar")
public class TGoodsOnedollarEntity {
    private int id;
    private Integer goodsId;
    private Timestamp fromtime;
    private Timestamp totime;
    private Integer need;
    private Integer fill;
    private Integer assume;
    private Timestamp lasttime;
    private Timestamp firsttime;
    private String name;
    private String subname;
    private Timestamp endtime;
    private Integer type;
    private Double percent;
    private Integer applyStatus;
    private Integer stage;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "goods_id", nullable = true, insertable = true, updatable = true)
    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    @Basic
    @Column(name = "stage", nullable = true, insertable = true, updatable = true)
    public Integer getStage() {
        return stage;
    }

    public void setStage(Integer stage) {
        this.stage = stage;
    }

    @Basic
    @Column(name = "fromtime", nullable = true, insertable = true, updatable = true)
    public Timestamp getFromtime() {
        return fromtime;
    }

    public void setFromtime(Timestamp fromtime) {
        this.fromtime = fromtime;
    }

    @Basic
    @Column(name = "totime", nullable = true, insertable = true, updatable = true)
    public Timestamp getTotime() {
        return totime;
    }

    public void setTotime(Timestamp totime) {
        this.totime = totime;
    }

    @Basic
    @Column(name = "need", nullable = true, insertable = true, updatable = true)
    public Integer getNeed() {
        return need;
    }

    public void setNeed(Integer need) {
        this.need = need;
    }

    @Basic
    @Column(name = "fill", nullable = true, insertable = true, updatable = true)
    public Integer getFill() {
        return fill;
    }

    public void setFill(Integer fill) {
        this.fill = fill;
    }

    @Basic
    @Column(name = "assume", nullable = true, insertable = true, updatable = true)
    public Integer getAssume() {
        return assume;
    }

    public void setAssume(Integer assume) {
        this.assume = assume;
    }

    @Basic
    @Column(name = "lasttime", nullable = true, insertable = true, updatable = true)
    public Timestamp getLasttime() {
        return lasttime;
    }

    public void setLasttime(Timestamp lasttime) {
        this.lasttime = lasttime;
    }

    @Basic
    @Column(name = "firsttime", nullable = true, insertable = true, updatable = true)
    public Timestamp getFirsttime() {
        return firsttime;
    }

    public void setFirsttime(Timestamp firsttime) {
        this.firsttime = firsttime;
    }

    @Basic
    @Column(name = "name", nullable = true, insertable = true, updatable = true, length = 250)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "subname", nullable = true, insertable = true, updatable = true, length = 250)
    public String getSubname() {
        return subname;
    }

    public void setSubname(String subname) {
        this.subname = subname;
    }

    @Basic
    @Column(name = "endtime", nullable = true, insertable = true, updatable = true)
    public Timestamp getEndtime() {
        return endtime;
    }

    public void setEndtime(Timestamp endtime) {
        this.endtime = endtime;
    }

    @Basic
    @Column(name = "type", nullable = true, insertable = true, updatable = true)
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Basic
    @Column(name = "percent", nullable = true, insertable = true, updatable = true, precision = 0)
    public Double getPercent() {
        return percent;
    }

    public void setPercent(Double percent) {
        this.percent = percent;
    }

    @Basic
    @Column(name = "apply_status", nullable = true, insertable = true, updatable = true)
    public Integer getApplyStatus() {
        return applyStatus;
    }

    public void setApplyStatus(Integer applyStatus) {
        this.applyStatus = applyStatus;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TGoodsOnedollarEntity that = (TGoodsOnedollarEntity) o;

        if (id != that.id) return false;
        if (goodsId != null ? !goodsId.equals(that.goodsId) : that.goodsId != null) return false;
        if (fromtime != null ? !fromtime.equals(that.fromtime) : that.fromtime != null) return false;
        if (totime != null ? !totime.equals(that.totime) : that.totime != null) return false;
        if (need != null ? !need.equals(that.need) : that.need != null) return false;
        if (fill != null ? !fill.equals(that.fill) : that.fill != null) return false;
        if (assume != null ? !assume.equals(that.assume) : that.assume != null) return false;
        if (lasttime != null ? !lasttime.equals(that.lasttime) : that.lasttime != null) return false;
        if (firsttime != null ? !firsttime.equals(that.firsttime) : that.firsttime != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (subname != null ? !subname.equals(that.subname) : that.subname != null) return false;
        if (endtime != null ? !endtime.equals(that.endtime) : that.endtime != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;
        if (percent != null ? !percent.equals(that.percent) : that.percent != null) return false;
        if (applyStatus != null ? !applyStatus.equals(that.applyStatus) : that.applyStatus != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (goodsId != null ? goodsId.hashCode() : 0);
        result = 31 * result + (fromtime != null ? fromtime.hashCode() : 0);
        result = 31 * result + (totime != null ? totime.hashCode() : 0);
        result = 31 * result + (need != null ? need.hashCode() : 0);
        result = 31 * result + (fill != null ? fill.hashCode() : 0);
        result = 31 * result + (assume != null ? assume.hashCode() : 0);
        result = 31 * result + (lasttime != null ? lasttime.hashCode() : 0);
        result = 31 * result + (firsttime != null ? firsttime.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (subname != null ? subname.hashCode() : 0);
        result = 31 * result + (endtime != null ? endtime.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (percent != null ? percent.hashCode() : 0);
        result = 31 * result + (applyStatus != null ? applyStatus.hashCode() : 0);
        return result;
    }
}
